﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using RM2012Server.Model;
using System.Data;
using RM2012Server.Business;

namespace RM2012Server.Controller
{
    public class InventoryCtrl
    {
        InventoryDAO m_InventoryDAO = new InventoryDAO();

        public DataTable GetAll()
        {
            return m_InventoryDAO.GetAll();
        }

        public DataTable GetAllFull()
        {
            return m_InventoryDAO.GetAllFull();
        }

        public DataTable GetById(String inventoryId)
        {
            return m_InventoryDAO.GetById(inventoryId);
        }

        public DataTable GetByIdFull(String inventoryId)
        {
            return m_InventoryDAO.GetByIdFull(inventoryId);
        }

        public DataTable GetByType(String typeId)
        {
            return m_InventoryDAO.GetByType(typeId);
        }

        public DataTable GetByTypeFull(String typeId)
        {
            return m_InventoryDAO.GetByTypeFull(typeId);
        }

        public DataTable GetByDate(DateTime inventoryDate)
        {
            return m_InventoryDAO.GetByDate(inventoryDate);
        }

        public DataTable GetBySupplier(String supplierId)
        {
            return m_InventoryDAO.GetBySupplier(supplierId);
        }

        public DataTable GetByUser(String userId)
        {
            return m_InventoryDAO.GetByUser(userId);
        }

        public DataTable GetImportYear(int year)
        {
            return m_InventoryDAO.GetImportYear(year);
        }

        public DataTable GetImportMonth(int year, int month)
        {
            return m_InventoryDAO.GetImportMonth(year, month);
        }

        public int Add(InventoryInfo info)
        {
            return m_InventoryDAO.Add(info);
        }

        public int Update(InventoryInfo info)
        {
            return m_InventoryDAO.Update(info);
        }

        public int UpdateTotal(InventoryInfo info)
        {
            return m_InventoryDAO.UpdateTotal(info);
        }

        public int Delete(String inventoryId)
        {
            return m_InventoryDAO.Delete(inventoryId);
        }

        public DataRow AddNewRow()
        {
            return m_InventoryDAO.AddNewRow();
        }

        public void AddNewInventory(DataRow m_Row)
        {
            m_InventoryDAO.AddNewInventory(m_Row);
        }

        public bool SaveData()
        {
            return m_InventoryDAO.SaveData();
        }
    }
}
